<?php
/* @var $this SiteController */

$this->pageTitle=Yii::app()->name;
?>
<script>
	function getMajorList(gid)
	{
		$('#major').load('<?php echo Yii::app()->request->baseUrl;?>/notification/getmajorlist?gid='+gid);
	}
</script>
<div class="container" style="width:600px;height:400px;padding-top:100px">
    <div class="jumbotron">
			<form action="<?php echo Yii::app()->request->baseUrl; ?>/notification/addNewClass" method="post" accept-charset="utf-8" role="form">
				<div class="container">
					<h2>添加班级</h2>
					<table class="table">  
						<label>所属年级</label>
						<select id="grade" name="grade" class="form-control">'
						<?php 
							$gradeList=Grade::model()->findAll();
							$res='';
							for ($i=0;$i<count($gradeList);$i++)
							{
								$res=$res.'<option value="'.$gradeList[$i]->grade_id.'">'.$gradeList[$i]->name.'</option>';
							}
							echo $res;
						?>
						</select>
						<label>所属院系</label>
						<select id="department" name="department" class="form-control">
						<?php 
							$departmentList=Department::model()->findAll();
							$res='';
							for ($i=0;$i<count($departmentList);$i++)
							{
								$res=$res.'<option value="'.$departmentList[$i]->department_id.'">'.$departmentList[$i]->name.'</option>';
							}
							echo $res;
						?>
						</select>
						<label>所属专业</label>
						<select id="major" name="major" class="form-control">
						<?php 
							$majorList=Major::model()->findAll();
							$res='';
							for ($i=0;$i<count($majorList);$i++)
							{
								$res=$res.'<option value="'.$majorList[$i]->major_id.'">'.$majorList[$i]->name.'</option>';
							}
							echo $res;
						?>
						</select>
						<tr>
							<td><input type="text" name="name" class="form-control" placeholder="班级名" required /></td>
						</tr>
						<tr>
							<td><input class="btn btn-primary" type="submit" role="button" value="添加"/></td>
							<td><a class="btn btn-success" href="<?php echo Yii::app()->request->baseUrl; ?>/notification/classManagePage" role="button">返回</a></td> 
						</tr>
						
					</table>  
				</div>
			</form>
	</div>
</div>

